home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2008 February / PCWFEB08.iso / Software / Resources / Developers / XAMPP 1.5.4 / Windows installer / xampp-win32-1.5.4-installer.exe / xampp / phpMyAdmin / lang / add_message.sh < prev    next >
Encoding:
Linux/UNIX/POSIX Shell Script  |  2005-09-23  |  767 b   |  33 lines

  1. #!/bin/bash
  2. # $Id: add_message.sh,v 2.1 2005/09/24 08:52:18 nijel Exp $
  3. #
  4. # Shell script that adds a message to all message files (Lem9)
  5. #
  6. # Example:  add_message.sh '$strNewMessage' 'new message contents'
  7. #
  8.  
  9. if [ $# -ne 2 ] ; then
  10.     echo "usage: add_message.sh '\$strNewMessage' 'new message contents'"
  11.     exit 1
  12. fi
  13.  
  14. for file in *.inc.php
  15. do
  16.     echo $file " "
  17.     grep -v '?>' ${file} > ${file}.new
  18.     case $file in
  19.         english*)
  20.             echo "$1 = '"$2"';" >> ${file}.new
  21.             ;;
  22.         *)
  23.             echo "$1 = '"$2"';  //to translate" >> ${file}.new
  24.             ;;
  25.     esac
  26.     echo "?>" >> ${file}.new
  27.     rm $file
  28.     mv ${file}.new $file
  29. done
  30. ./sort_lang.sh english*
  31. echo " "
  32. echo "Message added to all message files (including english)"
  33.